<?php
// 本类由系统自动生成，仅供测试用途
class ProductAction extends CommAction{
    public function index(){

		
		
		if($_GET['cid']){
			$cname = D('category')->where("cid = '".$_GET['cid']."'")->find();
			$data = D('product_view')->where("cid = '".$_GET['cid']."'")->findall();
						
			$this->assign("cname",$cname['cname']);		
			$this->assign("product",$data);
			$this->display("public:product_list");

		}
		elseif($_GET['pid']){
			
			$data = D('product_view')->where("pid = '".$_GET['pid']."'")->find();
			$this->assign("product",$data);
			$this->display("public:product_detail");

		}
		else{
			$url = "__ROOT__/Attachments/category/";
			$this->assign("url",$url);
			$catergory = D('category')->findall();
			$this->assign("catergory",$catergory);
			$this->display("public:product");
		}
   		
    
     }
}
?>